//
//  VoiceRoomList.m
//  YouSheng
//
//  Created by aaa on 16/8/24.
//  Copyright © 2016年 FanShuHan. All rights reserved.
//

#import "VoiceRoomList.h"
#import "YSVoiceRoomListCell.h"
#import "YSVoiceRoomController.h"
static NSString *cellId = @"cellId";

@implementation VoiceRoomList
- (void)viewDidLoad {
    [super viewDidLoad];
    self.tableView.rowHeight = 70;
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.tableView registerNib:[UINib nibWithNibName:@"YSVoiceRoomListCell" bundle:nil] forCellReuseIdentifier:cellId];
    self.tableView.backgroundColor = [UIColor darkGrayColor];
}

#pragma mark - UITableViewDataSoure
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    YSVoiceRoomListCell * cell = [tableView dequeueReusableCellWithIdentifier:cellId];
    if (indexPath.row == 1) {
        cell.roomNameLabel.text = @"河北人一起嗨";
        cell.onLineNumberLabel.text = @"2302人";
    } else if (indexPath.row == 2) {
        cell.roomNameLabel.text = @"四川人刷火锅";
        cell.onLineNumberLabel.text = @"882人";
    }
    return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    UIStoryboard *sb = [UIStoryboard storyboardWithName:NSStringFromClass([YSVoiceRoomController class]) bundle:nil];
    YSVoiceRoomController *vc = [sb instantiateInitialViewController];
    [self.navigationController pushViewController:vc animated:YES];
}
- (void)onTouchAvatar:(id)sender {
    
}
@end
